import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 健康教育记录信息 */
export interface ReportHealthEdu {
          id: number; // 编号
          schoolCode?: string; // 园区
          eduTime: string | Dayjs; // 健康教育时间
          sort?: number; // 排序
          status?: number; // 状态
  }

// 健康教育记录 API
export const ReportHealthEduApi = {
  // 查询健康教育记录分页
  getReportHealthEduPage: async (params: any) => {
    return await request.get({ url: `/school/report-health-edu/page`, params })
  },

  // 查询健康教育记录详情
  getReportHealthEdu: async (id: number) => {
    return await request.get({ url: `/school/report-health-edu/get?id=` + id })
  },

  // 新增健康教育记录
  createReportHealthEdu: async (data: ReportHealthEdu) => {
    return await request.post({ url: `/school/report-health-edu/create`, data })
  },

  // 修改健康教育记录
  updateReportHealthEdu: async (data: ReportHealthEdu) => {
    return await request.put({ url: `/school/report-health-edu/update`, data })
  },

  // 删除健康教育记录
  deleteReportHealthEdu: async (id: number) => {
    return await request.delete({ url: `/school/report-health-edu/delete?id=` + id })
  },

  /** 批量删除健康教育记录 */
  deleteReportHealthEduList: async (ids: number[]) => {
    return await request.delete({ url: `/school/report-health-edu/delete-list?ids=${ids.join(',')}` })
  },

  // 导出健康教育记录 Excel
  exportReportHealthEdu: async (params) => {
    return await request.download({ url: `/school/report-health-edu/export-excel`, params })
  },
}